<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OrangeCNC - ARISC firmware documentation: mod_pulsgen.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OrangeCNC - ARISC firmware documentation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('mod__pulsgen_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">mod_pulsgen.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>pulses generator module  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="mod__timer_8h_source.html">mod_timer.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mod__gpio_8h_source.html">mod_gpio.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mod__pulsgen_8h_source.html">mod_pulsgen.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a2ac838d9e64c5d4788ca9a6044f2d438"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#a2ac838d9e64c5d4788ca9a6044f2d438">pulsgen_module_init</a> ()</td></tr>
<tr class="memdesc:a2ac838d9e64c5d4788ca9a6044f2d438"><td class="mdescLeft">&#160;</td><td class="mdescRight">module init  <a href="#a2ac838d9e64c5d4788ca9a6044f2d438">More...</a><br /></td></tr>
<tr class="separator:a2ac838d9e64c5d4788ca9a6044f2d438"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e4e48600db54f687841b493229aff25"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#a0e4e48600db54f687841b493229aff25">pulsgen_module_base_thread</a> ()</td></tr>
<tr class="memdesc:a0e4e48600db54f687841b493229aff25"><td class="mdescLeft">&#160;</td><td class="mdescRight">module base thread  <a href="#a0e4e48600db54f687841b493229aff25">More...</a><br /></td></tr>
<tr class="separator:a0e4e48600db54f687841b493229aff25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf0da9f93d3f28063e2e7e5fd5aedcd1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#aaf0da9f93d3f28063e2e7e5fd5aedcd1">pulsgen_pin_setup</a> (uint8_t c, uint8_t port, uint8_t pin, uint8_t inverted)</td></tr>
<tr class="memdesc:aaf0da9f93d3f28063e2e7e5fd5aedcd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">setup GPIO pin for the selected channel  <a href="#aaf0da9f93d3f28063e2e7e5fd5aedcd1">More...</a><br /></td></tr>
<tr class="separator:aaf0da9f93d3f28063e2e7e5fd5aedcd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade550796ab335050c69edad17eaf901d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#ade550796ab335050c69edad17eaf901d">pulsgen_task_add</a> (uint32_t c, uint32_t toggles_dir, uint32_t toggles, uint32_t pin_setup_time, uint32_t pin_hold_time, uint32_t start_delay)</td></tr>
<tr class="memdesc:ade550796ab335050c69edad17eaf901d"><td class="mdescLeft">&#160;</td><td class="mdescRight">add a new task for the selected channel  <a href="#ade550796ab335050c69edad17eaf901d">More...</a><br /></td></tr>
<tr class="separator:ade550796ab335050c69edad17eaf901d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fd45bd82867966136b402354ca5b378"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#a3fd45bd82867966136b402354ca5b378">pulsgen_abort</a> (uint8_t c, uint8_t on_hold)</td></tr>
<tr class="memdesc:a3fd45bd82867966136b402354ca5b378"><td class="mdescLeft">&#160;</td><td class="mdescRight">abort current task for the selected channel  <a href="#a3fd45bd82867966136b402354ca5b378">More...</a><br /></td></tr>
<tr class="separator:a3fd45bd82867966136b402354ca5b378"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae49c2b0c123c0328dc0b352edf1ccc56"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#ae49c2b0c123c0328dc0b352edf1ccc56">pulsgen_state_get</a> (uint8_t c)</td></tr>
<tr class="memdesc:ae49c2b0c123c0328dc0b352edf1ccc56"><td class="mdescLeft">&#160;</td><td class="mdescRight">get current task state for the selected channel  <a href="#ae49c2b0c123c0328dc0b352edf1ccc56">More...</a><br /></td></tr>
<tr class="separator:ae49c2b0c123c0328dc0b352edf1ccc56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47e187a3a4d2366e008411c2eb41f7a5"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#a47e187a3a4d2366e008411c2eb41f7a5">pulsgen_task_toggles_get</a> (uint8_t c)</td></tr>
<tr class="memdesc:a47e187a3a4d2366e008411c2eb41f7a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">get current pin state changes since task start  <a href="#a47e187a3a4d2366e008411c2eb41f7a5">More...</a><br /></td></tr>
<tr class="separator:a47e187a3a4d2366e008411c2eb41f7a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf0f038aea5a130a3f24c34654bd0eaf"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#aaf0f038aea5a130a3f24c34654bd0eaf">pulsgen_cnt_get</a> (uint8_t c)</td></tr>
<tr class="memdesc:aaf0f038aea5a130a3f24c34654bd0eaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">get total pin toggles  <a href="#aaf0f038aea5a130a3f24c34654bd0eaf">More...</a><br /></td></tr>
<tr class="separator:aaf0f038aea5a130a3f24c34654bd0eaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a982410ed1bac5a0db27b60b027ac9406"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#a982410ed1bac5a0db27b60b027ac9406">pulsgen_cnt_set</a> (uint8_t c, int32_t value)</td></tr>
<tr class="memdesc:a982410ed1bac5a0db27b60b027ac9406"><td class="mdescLeft">&#160;</td><td class="mdescRight">set total pin toggles value  <a href="#a982410ed1bac5a0db27b60b027ac9406">More...</a><br /></td></tr>
<tr class="separator:a982410ed1bac5a0db27b60b027ac9406"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a686d12d41d8c446583a29ab6d6db5999"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#a686d12d41d8c446583a29ab6d6db5999">pulsgen_tasks_done_get</a> (uint8_t c)</td></tr>
<tr class="memdesc:a686d12d41d8c446583a29ab6d6db5999"><td class="mdescLeft">&#160;</td><td class="mdescRight">get total pin toggles  <a href="#a686d12d41d8c446583a29ab6d6db5999">More...</a><br /></td></tr>
<tr class="separator:a686d12d41d8c446583a29ab6d6db5999"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a176dc5c37ce6f627e4344e45b9b7c265"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#a176dc5c37ce6f627e4344e45b9b7c265">pulsgen_tasks_done_set</a> (uint8_t c, uint32_t tasks)</td></tr>
<tr class="memdesc:a176dc5c37ce6f627e4344e45b9b7c265"><td class="mdescLeft">&#160;</td><td class="mdescRight">set total pin toggles value  <a href="#a176dc5c37ce6f627e4344e45b9b7c265">More...</a><br /></td></tr>
<tr class="separator:a176dc5c37ce6f627e4344e45b9b7c265"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae47f3fa6b83367afb1ed891a2566882c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#ae47f3fa6b83367afb1ed891a2566882c">pulsgen_watchdog_setup</a> (uint8_t enable, uint32_t time)</td></tr>
<tr class="memdesc:ae47f3fa6b83367afb1ed891a2566882c"><td class="mdescLeft">&#160;</td><td class="mdescRight">enable/disable <code>abort all</code> watchdog  <a href="#ae47f3fa6b83367afb1ed891a2566882c">More...</a><br /></td></tr>
<tr class="separator:ae47f3fa6b83367afb1ed891a2566882c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03a23b001e94bf2b0bf906148fbc96fb"><td class="memItemLeft" align="right" valign="top">int8_t volatile&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#a03a23b001e94bf2b0bf906148fbc96fb">pulsgen_msg_recv</a> (uint8_t type, uint8_t *msg, uint8_t length)</td></tr>
<tr class="memdesc:a03a23b001e94bf2b0bf906148fbc96fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">"message received" callback  <a href="#a03a23b001e94bf2b0bf906148fbc96fb">More...</a><br /></td></tr>
<tr class="separator:a03a23b001e94bf2b0bf906148fbc96fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a4c7ffa9d73e9b28219932f5a05140099"><td class="memItemLeft" align="right" valign="top">volatile uint32_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mod__pulsgen_8c.html#a4c7ffa9d73e9b28219932f5a05140099">gpio_port_data</a> [<a class="el" href="mod__gpio_8h.html#a188c33baad9a9f4dffd2ed5040b274c7">GPIO_PORTS_CNT</a>]</td></tr>
<tr class="separator:a4c7ffa9d73e9b28219932f5a05140099"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>pulses generator module </p>
<p>This module implements an API to make real-time pulses generation using GPIO </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a2ac838d9e64c5d4788ca9a6044f2d438"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ac838d9e64c5d4788ca9a6044f2d438">&#9670;&nbsp;</a></span>pulsgen_module_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pulsgen_module_init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>module init </p>
<dl class="section note"><dt>Note</dt><dd>call this function only once before <a class="el" href="mod__pulsgen_8c.html#a0e4e48600db54f687841b493229aff25" title="module base thread ">pulsgen_module_base_thread()</a> </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_pulsgen_8c-example.html#a1">mod_pulsgen.c</a>.</dd>
</dl>
</div>
</div>
<a id="a0e4e48600db54f687841b493229aff25"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e4e48600db54f687841b493229aff25">&#9670;&nbsp;</a></span>pulsgen_module_base_thread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pulsgen_module_base_thread </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>module base thread </p>
<dl class="section note"><dt>Note</dt><dd>call this function in the main loop, before gpio_module_base_thread() </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_pulsgen_8c-example.html#a5">mod_pulsgen.c</a>.</dd>
</dl>
</div>
</div>
<a id="aaf0da9f93d3f28063e2e7e5fd5aedcd1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf0da9f93d3f28063e2e7e5fd5aedcd1">&#9670;&nbsp;</a></span>pulsgen_pin_setup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pulsgen_pin_setup </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>inverted</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>setup GPIO pin for the selected channel </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
    <tr><td class="paramname">port</td><td>GPIO port number </td></tr>
    <tr><td class="paramname">pin</td><td>GPIO pin number </td></tr>
    <tr><td class="paramname">inverted</td><td>invert pin state?</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_pulsgen_8c-example.html#a2">mod_pulsgen.c</a>.</dd>
</dl>
</div>
</div>
<a id="ade550796ab335050c69edad17eaf901d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade550796ab335050c69edad17eaf901d">&#9670;&nbsp;</a></span>pulsgen_task_add()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pulsgen_task_add </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>toggles_dir</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>toggles</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin_setup_time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin_hold_time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>start_delay</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>add a new task for the selected channel </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
    <tr><td class="paramname">toggles</td><td>number of pin state changes </td></tr>
    <tr><td class="paramname">toggles_dir</td><td>0 = cnt++, !0 = cnt&ndash; </td></tr>
    <tr><td class="paramname">pin_setup_time</td><td>pin state setup_time (in nanoseconds) </td></tr>
    <tr><td class="paramname">pin_hold_time</td><td>pin state hold_time (in nanoseconds) </td></tr>
    <tr><td class="paramname">start_delay</td><td>task start delay (in nanoseconds)</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_pulsgen_8c-example.html#a4">mod_pulsgen.c</a>.</dd>
</dl>
</div>
</div>
<a id="a3fd45bd82867966136b402354ca5b378"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3fd45bd82867966136b402354ca5b378">&#9670;&nbsp;</a></span>pulsgen_abort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pulsgen_abort </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>on_hold</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>abort current task for the selected channel </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
    <tr><td class="paramname">on_hold</td><td>0 = on pin state setup, !0 = on hold </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae49c2b0c123c0328dc0b352edf1ccc56"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae49c2b0c123c0328dc0b352edf1ccc56">&#9670;&nbsp;</a></span>pulsgen_state_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t pulsgen_state_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get current task state for the selected channel </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>(channel have no task) </td></tr>
    <tr><td class="paramname">1</td><td>(channel have a task) </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mod_pulsgen_8c-example.html#a6">mod_pulsgen.c</a>.</dd>
</dl>
</div>
</div>
<a id="a47e187a3a4d2366e008411c2eb41f7a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a47e187a3a4d2366e008411c2eb41f7a5">&#9670;&nbsp;</a></span>pulsgen_task_toggles_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t pulsgen_task_toggles_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get current pin state changes since task start </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0..0xFFFFFFFF</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aaf0f038aea5a130a3f24c34654bd0eaf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf0f038aea5a130a3f24c34654bd0eaf">&#9670;&nbsp;</a></span>pulsgen_cnt_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t pulsgen_cnt_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get total pin toggles </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">integer</td><td>4-bytes </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a982410ed1bac5a0db27b60b027ac9406"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a982410ed1bac5a0db27b60b027ac9406">&#9670;&nbsp;</a></span>pulsgen_cnt_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pulsgen_cnt_set </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set total pin toggles value </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
    <tr><td class="paramname">value</td><td>integer 4-bytes </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a686d12d41d8c446583a29ab6d6db5999"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a686d12d41d8c446583a29ab6d6db5999">&#9670;&nbsp;</a></span>pulsgen_tasks_done_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t pulsgen_tasks_done_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get total pin toggles </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0..0xFFFFFFFF</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a176dc5c37ce6f627e4344e45b9b7c265"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a176dc5c37ce6f627e4344e45b9b7c265">&#9670;&nbsp;</a></span>pulsgen_tasks_done_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pulsgen_tasks_done_set </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>tasks</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>set total pin toggles value </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td>channel id </td></tr>
    <tr><td class="paramname">tasks</td><td>tasks count (0..0xFFFFFFFF) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ae47f3fa6b83367afb1ed891a2566882c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae47f3fa6b83367afb1ed891a2566882c">&#9670;&nbsp;</a></span>pulsgen_watchdog_setup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pulsgen_watchdog_setup </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>enable</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>enable/disable <code>abort all</code> watchdog </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">enable</td><td>0 = disable watchdog, other values - enable watchdog </td></tr>
    <tr><td class="paramname">time</td><td>watchdog wait time (in nanoseconds) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a03a23b001e94bf2b0bf906148fbc96fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03a23b001e94bf2b0bf906148fbc96fb">&#9670;&nbsp;</a></span>pulsgen_msg_recv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int8_t volatile pulsgen_msg_recv </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>"message received" callback </p>
<dl class="section note"><dt>Note</dt><dd>this function will be called automatically when a new message will arrive for this module.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>user defined message type (0..0xFF) </td></tr>
    <tr><td class="paramname">msg</td><td>pointer to the message buffer </td></tr>
    <tr><td class="paramname">length</td><td>the length of a message (0 .. MSG_LEN)</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>(message read) </td></tr>
    <tr><td class="paramname">-1</td><td>(message not read) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a4c7ffa9d73e9b28219932f5a05140099"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c7ffa9d73e9b28219932f5a05140099">&#9670;&nbsp;</a></span>gpio_port_data</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">volatile uint32_t* gpio_port_data[<a class="el" href="mod__gpio_8h.html#a188c33baad9a9f4dffd2ed5040b274c7">GPIO_PORTS_CNT</a>]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="mod__pulsgen_8c.html">mod_pulsgen.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
